<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/admin', function (Request $request) {
//        Route::post('login',[\Modules\Admin\Http\Controllers\AuthController::class,'login']);
//});

Route::group(["prefix"=>"admin","middleware"=>"AdminAuth"],function (){
    Route::GET('auth/me','AuthController@me');
    Route::GET('auth/logout','AuthController@logout');

    /****************************权限组***************************************/
    Route::POST('auth_group/store','AuthGroupController@store');
    Route::GET('auth_group/index','AuthGroupController@index');
    /****************************管理员***************************************/
    Route::POST('admin/store','AdminController@store');
    Route::GET('admin/edit','AdminController@edit');

});

//无需授权登录
Route::group(["prefix"=>"admin","middleware"=>"cores"],function (){
    Route::POST('auth/login','AuthController@login');
});

